package com.tanhua.dubbo.api;

import com.tanhua.model.mongo.Movement;
import com.tanhua.model.vo.PageResult;

import java.util.List;

/**
 * @author ck
 * @date 2021/11/13 18:15
 */
public interface MovementApi {

    /**
     * 发布动态
     * @param movement
     */
    public String publish(Movement movement);


    //根据用户id查询此用户发布的动态数据列表
    PageResult findByUserId(Long userId, Integer page, Integer pagesize);

    //查询朋友的动态
    List<Movement> findFriends(Long friendId, Integer page, Integer pagesize);


    //随机查询
    List<Movement> randomMovements(Integer counts);

    //根据pid数组查询动态
    List<Movement> findMovementsByPids(List<Long> pid);

    Movement findById(String movementId);

    //后台查询动态列表
    PageResult findByUserIds(Long uid, Integer state, Integer page, Integer pagesize);

    void update(String movementId, int state);
}
